function show() {
	var xhr = new XMLHttpRequest();
	var url = "https://www.easy-mock.com/mock/5aab74e282fe290e7f22d85d/qqmusic/recommend"
	xhr.open("GET", url)
	xhr.send();
	xhr.addEventListener("readystatechange", function(e) { //当状态值准备改变时
		if(xhr.readyState == 4 && xhr.status == 200) { //readyState状态值
			var obj = xhr.response
			var s = JSON.parse(obj);
			var t = s.radioList; //获取到了所有的数据

			console.log(t)
			var Narr = [];
			for(var j = 0; j < t.length; j++) {
				var tmp_obj = {};
				tmp_obj.picUrl = t[j].picUrl
				tmp_obj.Ftitle = t[j].Ftitle

				Narr.push(tmp_obj)
			}
			console.log(Narr)
			var dt = document.querySelector(".diantai");
			console.log(dt)
			var temp = "";
			for(var i = 0; i < Narr.length; i++) {
				temp += ti(i)
			}

			function ti(index) {
				return `
						
							<li>
								<a href="#">
									<img src="${Narr[index].picUrl}"/>
									<span><i class="iconfont icon-bofang"></i></span>
								</a>
								<h3><a href="#">${Narr[index].Ftitle}</a></h3>
							</li>
							
					`
			}
			dt.innerHTML += temp
		}
	})

}
show()

function songlist() {
				var xhr = new XMLHttpRequest();
				var url = "https://www.easy-mock.com/mock/5aab74e282fe290e7f22d85d/qqmusic/recommend"
				xhr.open("GET", url)
				xhr.send();
				xhr.addEventListener("readystatechange", function(e) { //当状态值准备改变时
					if(xhr.readyState == 4 && xhr.status == 200) { //readyState状态值
						var obj = xhr.response
						var s = JSON.parse(obj);
						console.log(s)
						var t = s.songList; //获取到了所有的数据

						console.log(t)
						var Narr = [];
						for(var j = 0; j < t.length; j++) {
							var tmp_obj = {};
							tmp_obj.picUrl = t[j].picUrl
							tmp_obj.songListDesc = t[j].songListDesc
							tmp_obj.songListAuthor = t[j].songListAuthor
							Narr.push(tmp_obj)
						}
						console.log(Narr)
						var remen = document.querySelector(".remen");
						console.log(remen)
						var temp = "";
						for(var i = 0; i < Narr.length; i++) {
							temp += ti(i)
						}

						function ti(index) {
							return `
									<li>
										<a href="#">
											<img src="${Narr[index].picUrl}" />
											<span><i class="iconfont icon-bofang"></i></span>
										</a>
										<h3><a href="#">${Narr[index].songListDesc}</a></h3>
										<p>
											<a href="#">${Narr[index].songListAuthor}</a>
										</p>
									</li>
					`
						}
						remen.innerHTML = temp
					}
				})

			}
			songlist()
			
			function tabs() {
				var li = document.querySelectorAll(".xuanxiang li");
				var div = document.getElementsByClassName("xuanx");
				console.log(li);
				console.log(div);
				for(let i = 0; i < li.length; i++) {
					li[i].addEventListener("click", function() {
						for(var j = 0; j < div.length; j++) {
							div[j].classList.remove("active");
							li[j].classList.remove("li_active");
						}
						li[i].classList.add("li_active");
						div[i].classList.add("active");
					})
				}
			}
			tabs();
			

function pop() {
				var xhr = new XMLHttpRequest();
				var url = "https://www.easy-mock.com/mock/5aab74e282fe290e7f22d85d/qqmusic/pop"
				xhr.open("GET", url)
				xhr.send();
				xhr.addEventListener("readystatechange", function(e) { //当状态值准备改变时
					if(xhr.readyState == 4 && xhr.status == 200) { //readyState状态值
						var obj = xhr.response
						var s = JSON.parse(obj);
						console.log(s)
						var t = s.topList; //获取到了所有的数据

						console.log(t)
						var Narr = [];
						for(var j = 0; j < t.length; j++) {
							var tmp_obj = {};
							tmp_obj.picUrl = t[j].picUrl
							tmp_obj.singername1 = t[j].songList[0].singername
							tmp_obj.songname1 = t[j].songList[0].songname
							tmp_obj.singername2 = t[j].songList[1].singername
							tmp_obj.songname2 = t[j].songList[1].songname
							tmp_obj.singername3 = t[j].songList[2].singername
							tmp_obj.songname3 = t[j].songList[2].songname
							tmp_obj.topTitle = t[j].topTitle
							Narr.push(tmp_obj)
						}
						console.log(Narr)
						var pop = document.querySelector(".pop");
						console.log(pop)
						var temp = "";
						for(var i = 0; i < Narr.length; i++) {
							temp += tii(i)
						}

						function tii(index) {
							return `
							<li>
								<div class="fl clearfix" >
									<img src="${Narr[index].picUrl}"/>
								</div>
								<div class="fr clearfix">
									<h3>${Narr[index].topTitle}</h3>
									<p>1<span>${Narr[index].songname1}</span>-${Narr[index].singername1}</p>
									<p>2<span>${Narr[index].songname2}</span>-${Narr[index].singername2}</p>
									<p>3<span>${Narr[index].songname3}</span>-${Narr[index].singername3}</p>	
									<div class="i"><a href=""><i class="iconfont icon-arrow-right"></i></a></div>
								</div>
							</li>
					`
						}
						pop.innerHTML = temp
					}
				})
			}
			pop()
			
		function search() {
		var xhr = new XMLHttpRequest();
		var url = "https://www.easy-mock.com/mock/5aab74e282fe290e7f22d85d/qqmusic/search"
		xhr.open("GET", url)
		xhr.send();
		xhr.addEventListener("readystatechange", function(e) { //当状态值准备改变时
			if(xhr.readyState == 4 && xhr.status == 200) { //readyState状态值
				var obj = xhr.response
				var s = JSON.parse(obj);
				console.log(s)
				var t = s.hotkey; //获取到了所有的数据

				console.log(t)
				var Narr = [];
				for(var j = 0; j < t.length/3; j++) {
					var tmp_obj = {};
					tmp_obj.k = t[j].k
					Narr.push(tmp_obj)
				}
				console.log(Narr)
				var search = document.querySelector(".sousuo div");
				
				var temp = "";
				for(var i = 0; i < Narr.length; i++) {
					temp += ti(i)
				}

				function ti(index) {
					return `
							<a href="#">${Narr[index].k}</a>
			`
				}
				search.innerHTML = temp
			}
		})

	}
	search()